package com.yunxi.estate.config.core.service;

import com.yunxi.estate.config.core.domain.AjaxResult;
import com.yunxi.estate.config.core.domain.LoginBody;
import com.yunxi.estate.config.core.domain.RegisterBody;
import com.yunxi.estate.domain.SysUser;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

/**
 * 登录注册业务
 *
 * @author 松子鱼
 */
public interface ILoginService {
    /**
     * 检查Cookies值
     *
     * @param req 请求值
     * @param user 用户对象
     */
    public SysUser CookiesCheck(HttpServletRequest req,SysUser user);

    /**
     * 添加Cookies值
     *
     * @param session 会话
     * @param user 用户对象
     * @param res 响应值
     */
    public void insertCookies(HttpSession session, SysUser user, HttpServletResponse res);

    /**
     * 查找登录对象
     *
     * @param loginInfo 登录信息
     * @return 用户对象
     */
    public SysUser selectLoginUser(LoginBody loginInfo);


    /**
     * 注册方法
     *
     * @return 注册状态信息
     */
    public AjaxResult register(RegisterBody register, HttpSession session);

    /**
     * 登录方法
     *
     * @return 登录状态信息
     */
    public AjaxResult login(SysUser loginUser, HttpSession session, HttpServletResponse res);


}
